app.controller('CanvaslCtrl', function($scope, $stateParams) {
    // console.log(123);
    var c = document.getElementById("myCanvas1");
    var ctx = c.getContext("2d");
    ctx.fillStyle = "#FF0000";
    ctx.beginPath();
    ctx.lineWidth = 7;
    ctx.strokeStyle = "#e2e2e2";
    ctx.fillStyle = "#fff";
    ctx.arc(150, 130, 100, 0, 2 * Math.PI);
    ctx.fill();
    ctx.stroke();

    function oo(val) {
        var c2 = document.getElementById("myCanvas2");
        var ctx2 = c.getContext("2d");
        ctx.fillStyle = "#fff";
        ctx.beginPath();
        ctx.lineWidth = 7;
        ctx.strokeStyle = "#999";
        ctx.lineCap = "round";
        ctx.fillStyle = "#fff";
        ctx.arc(150, 130, 100, 0, val * Math.PI);
        ctx.fill();
        ctx.stroke();
    };


    var i=1;
    var r = (i / 100) * 2;
    var tim = setInterval(function() {
        // console.log(i);
        r = (i / 100) * 2;
         oo(r);
         i++;
        if(i==50){
            clearInterval(tim);
        }
    }, 100);
    
    //id  颜色  线宽   位置top left
    $scope.off=function(){
        // console.log(123);
    }

});